﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Globalization;

namespace Prerequisites.Controllers
{
    public class ChartController : Controller
    {
        //
        // GET: /Chart/

        public ActionResult Index()
        {
            return View();
        }

        public JsonResult GetData()
        {
            Random rand = new Random();

            List<List<object>> data = new List<List<object>>();

            List<object> firstSeries = new List<object>();
            List<object> secondSeries = new List<object>();

            for (int i = 1; i <= 7; i++)
            {
                firstSeries.Add(new object[] { i , rand.Next(100) });
                secondSeries.Add(new object[] { i, rand.Next(100) });
            }

            data.Add(firstSeries);
            data.Add(secondSeries);

            return Json(data, JsonRequestBehavior.AllowGet);
        }
    }
}
